import com.alibaba.druid.pool.DruidDataSource;
import com.itheima.service.UserService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class UserApp {
    public static void main(String[] args) {
        ApplicationContext ctx = new ClassPathXmlApplicationContext("applicationContext.xml");
        // 可以配置多个核心配置文件
       // ApplicationContext ctx = new ClassPathXmlApplicationContext("applicationContext-user.xml","applicationContext-book.xml");
       //  UserService userService = (UserService) ctx.getBean("userService");
       //  userService.save();

       DruidDataSource dataSource = ctx.getBean("dataSource", DruidDataSource.class);
       System.out.println(dataSource);



    }
}
